﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NumbersofCapitalandSmall
{
    class Program
    {
        /// <summary>
        /// 统计大小写字母个数
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            Console.Write("请输入一串包含大小写的字符串：");
            string str = Console.ReadLine();
            int num1 = 0;
            int num2 = 0;
            foreach (char c  in str)
            {
                if (c>='A'&&c<='Z')
                {
                    num1++;
                }
                else if (c >= 'a' && c <= 'z')
                {
                    num2++;
                }
            }
            Console.WriteLine($"大写字母的个数为{num1},小写字母的个数为{num2}。");
            Console.ReadKey();

        }
    }
}
